Skip to content

feat(inbox): filter reports by priority#2176

Open
oliverb123 wants to merge 2 commits into
mainfrom
posthog-code/inbox-priority-filter
Open

feat(inbox): filter reports by priority#2176
oliverb123 wants to merge 2 commits into
mainfrom
posthog-code/inbox-priority-filter

Conversation

@oliverb123
Copy link
Copy Markdown
Contributor

Summary

  • Adds a Priority section (P0–P4) to the inbox filter popover alongside the existing Sort by / Status / Source sections.
  • Selections persist with the other filter prefs and reset via resetFilters (deep-link safe).
  • Wires through to the new priority query parameter on GET /api/projects/<team_id>/signals/reports/ (backend shipped in PostHog/posthog#58784). Comma-separated P0..P4.

Test plan

  • pnpm --filter code typecheck passes
  • pnpm --filter code test — all 1233 tests pass; 13 in inboxSignalsFilterStore.test.ts, 20 in filterReports.test.ts
  • Biome clean
  • Manual: open Inbox → funnel icon → Priority section visible; toggle P0 → list refetches with &priority=P0; toggle P1 → &priority=P0,P1; clearing all removes the param; selection persists across reload
  • Manual: deep-link to a report whose priority is not in the active filter — resetFilters clears the filter and the report is visible

Adds a Priority section (P0-P4) to the inbox filter popover, mirroring
the existing source-product filter pattern. Selections are persisted
alongside the other filter prefs and sent to the new `priority` query
parameter on the signals reports list endpoint.

Backend support shipped in PostHog/posthog#58784.

Generated-By: PostHog Code
Task-Id: a20149cc-595e-49b3-b2a9-e12641b73dbc
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/inbox/utils/filterReports.test.ts:158-172
The three `buildPriorityFilterParam` cases are independent input→output pairs on the same function, making them a textbook candidate for `it.each`. The team's preference is parameterised tests, and the current structure repeats the same pattern three times.

```suggestion
describe("buildPriorityFilterParam", () => {
  it.each([
    { input: [], expected: undefined },
    { input: ["P0", "P1", "P2"], expected: "P0,P1,P2" },
    { input: ["P0", "P1", "P0", "P2", "P1"], expected: "P0,P1,P2" },
  ] as const)("buildPriorityFilterParam($input) → $expected", ({ input, expected }) => {
    expect(buildPriorityFilterParam(input as SignalReportPriority[])).toBe(expected);
  });
});
```

Reviews (1): Last reviewed commit: "feat(inbox): filter reports by priority" | Re-trigger Greptile

Comment thread apps/code/src/renderer/features/inbox/utils/filterReports.test.ts
Addresses Greptile review feedback on #2176.

Generated-By: PostHog Code
Task-Id: a20149cc-595e-49b3-b2a9-e12641b73dbc
Copy link
Copy Markdown
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we'll have to split that filter into more dropdowns, but it's fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants